package jdbc;

import java.sql.*;
import java.util.Scanner;

public class JdbcDemo3 {
    public static void main(String[] args) throws ClassNotFoundException, SQLException {
       Connection connection = DBUtil.getConnection();
        Statement statement = connection.createStatement();
        Scanner scanner = new Scanner(System.in);
        System.out.println("请输入用户名");
        String username = scanner.nextLine();
        System.out.println("请输入密码");
        String password = scanner.nextLine();
        String sql = "delete from userinfo where username = '" + username + "' and password = '" + password + "'";
        int i = statement.executeUpdate(sql);
        if (i >0) {
            System.out.println("注销成功");
        }else {
            System.out.println("注销失败");
        }
        connection.close();

    }
}
